import time
from selenium import webdriver
import pytest
from selenium.webdriver.common.by import By
import allure

class Testlogintest():

    def setup(self):
        pass

    @allure.step(title="登录账号")
    def test_login(self):
        driver = webdriver.Chrome()
        driver.set_page_load_timeout(3)
        try:
            driver.get("http://106.75.230.116/")
        except:
            pass
        # 登录账号
        driver.find_element(by=By.CLASS_NAME, value="red").click()
        time.sleep(3)
        driver.find_element(by=By.ID, value="username").send_keys("13800138006")
        driver.find_element(by=By.ID, value="password").send_keys("123456")
        driver.find_element(by=By.NAME, value="verify_code").send_keys("8888")
        driver.find_element(by=By.XPATH, value='//*[@id="loginform"]/div/div[6]/a').click()
        time.sleep(3)
        driver.close()

if __name__ == "__main__":
    pytest.main(["-s","阶段7模块5代码.py"])
